// Tests / Functions / Heading

// th-heading()
// ------------------------------

function th-heading {

	@include th-assert(
		$describe: "Return heading"
	){
		@include th-assert-expect {
			result: (10px 20px (30px 40px));
		}
		@include th-assert-actual {
			result: th-heading(h1);
		}
	}

	@include th-assert(
		$describe: "Return heading by breakpoint"
	){
		@include th-assert-expect {
			result: (50px 60px (70px 80px) 768px);
		}
		@include th-assert-actual {
			result: th-heading(h1, 768px);
		}
	}

	@include th-assert(
		$describe: "Return a further heading by breakpoint"
	){
		@include th-assert-expect {
			result: (90px 100px (110px 120px) 1024px);
		}
		@include th-assert-actual {
			result: th-heading(h1, 1024px);
		}
	}

}

// th-heading-get-map()
// ------------------------------

function th-heading-get-map {

	@include th-assert(
		$describe: "Return heading map"
	){
		@include th-assert-expect {
			result: (5px);
		}
		@include th-assert-actual {
			result: th-heading-get-map(h6);
		}
	}

	@include th-assert(
		$describe: "Return heading map with breakpoint"
	){
		@include th-assert-expect {
			result: (10px 20px (30px 40px), 50px 60px (70px 80px) 768px, 90px 100px (110px 120px) 1024px);
		}
		@include th-assert-actual {
			result: th-heading-get-map(h1);
		}
	}

}

// th-heading-has-next()
// ------------------------------

function th-heading-has-next {

	@include th-assert(
		$describe: "Check for heading with next"
	){
		@include th-assert-expect {
			result: true;
		}
		@include th-assert-actual {
			result: _th-heading-has-next(h1);
		}
	}

	@include th-assert(
		$describe: "Check for heading without next"
	){
		@include th-assert-expect {
			result: false;
		}
		@include th-assert-actual {
			result: _th-heading-has-next(h6);
		}
	}

}

// th-heading-get-next()
// ------------------------------

function th-heading-get-next {

	@include th-assert(
		$describe: "Get heading with next"
	){
		@include th-assert-expect {
			result: (10px 20px (30px 40px));
		}
		@include th-assert-actual {
			result: _th-heading-get-next(h1);
		}
	}

	@include th-assert(
		$describe: "Get heading with next and breakpoint"
	){
		@include th-assert-expect {
			result: (50px 60px (70px 80px) 768px);
		}
		@include th-assert-actual {
			result: _th-heading-get-next(h1, 768px);
		}
	}

}

// th-h()
// ------------------------------

function th-h {

  @include th-assert(
    $describe: "Return heading"
  ){
    @include th-assert-expect {
      result: (10px 20px (30px 40px));
    }
    @include th-assert-actual {
      result: th-h(h1);
    }
  }

  @include th-assert(
    $describe: "Return heading by breakpoint"
  ){
    @include th-assert-expect {
      result: (50px 60px (70px 80px) 768px);
    }
    @include th-assert-actual {
      result: th-h(h1, 768px);
    }
  }

  @include th-assert(
    $describe: "Return a further heading by breakpoint"
  ){
    @include th-assert-expect {
      result: (90px 100px (110px 120px) 1024px);
    }
    @include th-assert-actual {
      result: th-h(h1, 1024px);
    }
  }

}